<h1>Listing pages</h1>

<table>
  <tr>
    <th>Url</th>
    <th>Average rating</th>
    <th>Total comments</th>
    <th>Total ratings</th>
    <th>Created at</th>
  </tr>
  
<% for page in @pages %>
  <tr>
    <td><%=h page.url %></td>
    <td><%=h page.average_rating %></td>
    <td><%=h page.total_comments %></td>
    <td><%=h page.total_ratings %></td>
    <td><%=h page.created_at %></td>
    <td><%= link_to 'Show', page_path(page) %></td>
    <td><%= link_to 'Edit', edit_page_path(page) %></td>
    <td><%= link_to 'Destroy', page_path(page), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New page', new_page_path %>